<?php
namespace app\admin\controller;
use think\Controller;
use think\Db;
use think\Session;
use think\Cookie;
header("content-type:text/html; charset=utf8");
class Index extends Controller{
    public function index(){


        return redirect("Login/index");
     }
    public function forget(){

         $get=$_GET["id"];
            $data=Db::table("admin")->where("id=".$get)->select();
            return view("forget",["aa"=>$data]);
        
//        return view("forget");
    }
    public function cancel(){
        Cookie::delete("username");
        return $this->index();
    }
    public function basic_gallery(){
        $data = Db::name("admin")->paginate(3);
        // 把分页数据赋值给模板变量$page
        $page = $data->render();
//        return view("register/information",array("aa"=>$data,"page"=>$page));
        return view("basic_gallery",array("aa"=>$data,"page"=>$page));
    }
    public function carousel(){
        return view("carousel");
    }
    public function admin(){
        if(!Cookie::has("admin_user")){
            $this->error("未登录","index",'',2);
        }else{
            return view("Index/index",["admin"=> Cookie::get('admin_user')]);
        }
    }
}
